package com.srolorz.fmtp.thread.pool.executor;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class ApplicationContext {
    private static volatile Map<String, Object> context = new ConcurrentHashMap<>();

    public void add(String key, Object value){
        context.put(key, value);
    }

    public Object get(String key){
        return context.get(key);
    }

    public static ApplicationContext build(){
        return Single.NEW_INSTANCE;
    }

    private static final class Single {
        private static final ApplicationContext NEW_INSTANCE = new ApplicationContext();
    }
}
